# Contributor: John Gebbie <me@johngebbie.com>
# Maintainer: John Gebbie <me@johngebbie.com>
pkgname=dotool
pkgver=1.5
pkgrel=0
pkgdesc="Command to simulate input anywhere (X11, Wayland, TTYs)"
url="https://sr.ht/~geb/dotool"
arch="all"
license="GPL-3.0-only"
makedepends="go libxkbcommon-dev scdoc"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~geb/dotool/archive/$pkgver.tar.gz
	dotoold.initd
	"
options="!check net" # no test suite

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	export DOTOOL_VERSION="$pkgver"
	export DOTOOL_DESTDIR="$pkgdir"
	export DOTOOL_BINDIR=usr/bin
	export DOTOOL_UDEV_RULES_DIR=usr/lib/udev/rules.d
	./build.sh
}

package() {
	./build.sh install
	install -Dm755 "$srcdir"/dotoold.initd "$pkgdir"/etc/init.d/dotoold
}

sha512sums="
f37c88984c1f87c4a9220d155498a79e63db12909325da6d673aeb9e872264473a18a67a7b2ac106fe36593bc7a5d34250716f675f517154de78023061faee7f  dotool-1.5.tar.gz
2d2744d75178aa57c653c5bdc6370caa205d96525f9aa6e5480c6c98c6f3528f0a4eb8997eb1d85acfadf97e790937244b017f5cc7981f2000908619b64dfed1  dotoold.initd
"
